CROSS_PREFIX = riscv64-unknown-elf-
CC = $(CROSS_PREFIX)gcc
USER_OBJS = apps/app_invalide_inst apps/app_helloworld apps/app_fork  apps/app_badaddr apps/app_page_fault_1   apps/app_page_fault_2 \
apps/app_wait apps/app_loop apps/init apps/sh apps/app_sound0 apps/app_sound1 apps/app_sound2 apps/app_testwrite
OBJ_DIR      := ../obj

USER_DESTS := $(addprefix $(OBJ_DIR)/, $(USER_OBJS)) 




all: $(OBJ_DIR)  $(USER_DESTS)
	@echo  "APPS compiled"


$(OBJ_DIR):
	@mkdir -p ../obj/apps


$(USER_DESTS): $(OBJ_DIR)/apps/% : ./%.c
	@echo  $(USER_DESTS)
	$(CC)  $< -o $@ -I ../kernel -I ../include  -I ../userlib -L ../userlib -luser
	
	

clean :
	rm -rf  ../obj/apps/*
